package com.csii.branch.activity.variable.impl;

import com.csii.activiti.server.core.entity.ActFlowNode;
import com.csii.activiti.server.core.variable.discover.ActVariableProcessorDiscover;
import org.activiti.engine.impl.persistence.entity.ExecutionEntityImpl;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 演示自定义变量
 */
@Component
public class ActFlowProjectManagerAllVariableProcessor implements ActVariableProcessorDiscover {

    private final String roleList ="pm";

    @Override
    public String getVariableName() {
        return "项目经理";
    }

    @Override
    public String getVariableType() {
        return "projectManagerAll";
    }

    @Override
    public boolean needManyPeopleReview() {
        return true;
    }

    @Override
    public boolean needEmptyProcessing() {
        return true;
    }

    @Override
    public int order() {
        return 10;
    }

    @Override
    public Set<String> getUsernames(ActFlowNode actFlowNode, String executionId, ExecutionEntityImpl processInstance) {
        List<String> usernames = new ArrayList<>();
        usernames.add("demo");
        usernames.add("admin");
        return new HashSet<>(usernames);
    }
}
